﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using System.Web.Caching;

namespace TPOJ.CacheDependencyFactory
{
    public static class DependencyFacade
    {
        private static readonly string path = ConfigurationManager.AppSettings["CacheDependencyAssembly"];

        public static AggregateCacheDependency GetProblemDependency()
        {
            if (string.IsNullOrEmpty(path))
                return DependencyAccess.CreateProblemDependency().GetDependency();
            else
                return null;
        }

        public static AggregateCacheDependency GetSolutionDependency()
        {
            if (string.IsNullOrEmpty(path))
                return DependencyAccess.CreateSolutionDependency().GetDependency();
            else
                return null;
        }

        public static AggregateCacheDependency GetContestDependency()
        {
            if (string.IsNullOrEmpty(path))
                return DependencyAccess.CreateContestDependency().GetDependency();
            else
                return null;
        }

        public static AggregateCacheDependency GetStandingDependency()
        {
            if (string.IsNullOrEmpty(path))
                return DependencyAccess.CreateStandingDependency().GetDependency();
            else
                return null;
        }

        public static AggregateCacheDependency getAccountDependency()
        {
            if (string.IsNullOrEmpty(path))
                return DependencyAccess.CreateAccountDependency().GetDependency();
            else
                return null;
        }
        
        public static AggregateCacheDependency GetForumMessageDependency()
        {
            if (string.IsNullOrEmpty(path))
                return DependencyAccess.CreateForumMessageDependency().GetDependency();
            else
                return null;
        }
    }
}
